From 23834a2ffdbbde5b6f012a9364d49a8fca9fd5fa Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 23 Jan 2007 15:26:17 +0000 Subject: [PATCH] [HVM] fix save/restore on 64b HV Enable hvm_ctxt ops for compat mode to fix HVM save/restore on 64b HV. Signed-off-by: Zhai Edwin --- xen/arch/x86/domctl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 0d8c0b4671..f29169e286 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -311,12 +311,16 @@ _long arch_do_domctl( ret = -EFAULT; -#ifndef CONFIG_COMPAT +#ifndef COMPAT if ( copy_from_guest(c, domctl->u.hvmcontext.ctxt, 1) != 0 ) +#else + if ( copy_from_guest(c, + compat_handle_cast(domctl->u.hvmcontext.ctxt, void), + 1) != 0 ) +#endif goto sethvmcontext_out; ret = arch_sethvm_ctxt(v, c); -#endif xfree(c); @@ -350,12 +354,16 @@ _long arch_do_domctl( if (arch_gethvm_ctxt(v, c) == -1) ret = -EFAULT; -#ifndef CONFIG_COMPAT +#ifndef COMPAT if ( copy_to_guest(domctl->u.hvmcontext.ctxt, c, 1) ) +#else + if ( copy_to_guest(compat_handle_cast(domctl->u.hvmcontext.ctxt, + void), + c, 1) ) ret = -EFAULT; +#endif xfree(c); -#endif if ( copy_to_guest(u_domctl, domctl, 1) ) ret = -EFAULT; -- 2.30.2